#ifndef _OBJECT_H_
#define _OBJECT_H_

#include "../Forces/forcecontainer.cpp"

locvar DEFSTARTPOINT = 0;
const char * spritestart = "NULL.png";
massvar MASSDEFAULT = 1;
massvar CHARGEDEFAULT = 0;
force FORCEDEFAULT;

class objectparent
{
    public:
        idtype id;
};

class object : public objectparent
{    
    public:
        object() : id(IDCOUNTER++), x(DEFSTARTPOINT), y(DEFSTARTPOINT), sprite(spritestart), mass(MASSDEFAULT), charge(CHARGEDEFAULT) {};
        object(const object& other) : x(other.x), y(other.y), sprite(other.sprite) { };
        
        void jump(locvar, locvar);
        void move();
		
		locvar getSpeed() const;
        locvar getDirection() const;
        locvar getForceMagnitude() const;
        locvar getForceDirection() const;
        
        locvar getDistancePoint(locvar, locvar);
        locvar getDistanceOrigin();
        locvar getDistanceObject(const idtype);
        locvar getDirectionPoint(locvar, locvar);
        locvar getDirectionOrigin();
        locvar getDirectionObject(const idtype);
        
        void setSpeed(locvar);
        void setDirection(locvar);
        void setVelocityXY(locvar, locvar);
        void setVelocitySpDir(locvar, locvar);
        
        void updateVelocity();
        
        void newForceXY(locvar, locvar, bool, bool);
        void newForceMagDir(locvar, locvar, bool, bool);
        void addQuickGravity();
        
        idtype id;                    // position in objects vector, defined by global function createObject;
        locvar x,y,dx,dy;             // position, velocity
        forceContainer forces;        // stores forces
        const char * sprite;          // sprite filepath
        massvar mass;                 // object mass, do not make zero
        massvar charge;               // object charge, zero is fine here
};

vector<object> objects;

# endif
